<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>提升</title>
</head>
<body>
<script>
    var a;
    if(true){
        function a() {}
        a = 5; // 修改
        a = 0; // 重写
        console.log(a);
    }
    console.log(a);
    //========================
    var obj = new Object();
    if(true) {
        obj.name = 'hahah';
        obj = new Object();
        obj.name = '123';
        console.log(obj.name);
    }
    console.log(obj.name)
</script>
</body>
</html>
